/*
 * JaCoLiB
 * Copyright (C) 2008 Alessandro Serra
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */

package it.gashale.jacolib.shell;

import it.gashale.jacolib.core.JacolibError;
import it.gashale.jacolib.json.Serializer;
import it.gashale.jacolib.rpc.RPCChannel;

public class ShellChannel extends RPCChannel {
	private ShellInterface shell;
	private ShellServer server;
	
	public ShellChannel(Serializer serializer, ShellInterface shell) throws JacolibError {
		super(serializer);
		this.shell=shell;
		
		setRPCClient(new RemoteShell(getRPCClientStub()));
		server=new ShellServer(this.shell,(RemoteShell)getRPCClient());
		setRPCServer(server);	
	}
	public void quit_p() throws JacolibError {
		super.quit_p();
		shell=null;
		server=null;
	}
}
